# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 135
n 135(None)[return None
]:
	i: 49(), 94(), 115()
	o: 

nname: 115
n 115(None)[linked[receiver] = set([signal])
]:
	i: 81(f)
	o: 135()

nname: 94
n 94(None)[linked[receiver].add(signal)
]:
	i: 81(t)
	o: 135()

nname: 81
n 81(receiver in linked)[]:
	i: 0(f)
	o: 94(t), 115(f)

nname: 49
n 49(None)[_connected[sender] = {receiver: set([signal])}
]:
	i: 0(t)
	o: 135()

nname: 0
n 0(linked is None)[log.debug('Connecting receiver %s to sender %s on signal %s', receiver, sender, signal)
linked = _connected.get(sender)
]:
	i: 
	o: 49(t), 81(f)

nname: 0
n 0(None)[log.debug('Connecting receiver %s to sender %s on signal %s', receiver, sender, signal)
linked = _connected.get(sender)
if linked is None:
	_connected[sender] = {receiver: set([signal])}
else:
	if receiver in linked:
		linked[receiver].add(signal)
	else:
		linked[receiver] = set([signal])
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7676a4c>}
nname: 105
n 105(None)[]:
	i: 93(), 104()
	o: 

nname: 104
n 104(None)[]:
	i: 87(t)
	o: 105()

nname: 93
n 93(None)[del _connected[sender]
]:
	i: 87(f)
	o: 105()

nname: 87
n 87(linked)[]:
	i: 75(), 86()
	o: 93(f), 104(t)

nname: 86
n 86(None)[]:
	i: 0&63(f)
	o: 87()

nname: 75
n 75(None)[del linked[receiver]
]:
	i: 0&63(t)
	o: 87()

nname: 0&63
n 0&63(wipe or not linked[receiver])[log.debug('Disconnecting receiver %s from sender %s on signal %s (wipe=%s)', receiver, sender, signal, wipe)
linked = _connected.get(sender)
linked[receiver].discard(signal)
]:
	i: 
	o: 75(t), 86(f)

nname: 0&63
n 0&63(None)[log.debug('Disconnecting receiver %s from sender %s on signal %s (wipe=%s)', receiver, sender, signal, wipe)
linked = _connected.get(sender)
linked[receiver].discard(signal)
if wipe or not linked[receiver]:
	del linked[receiver]
if not linked:
	del _connected[sender]
]:
	i: 
	o: 

self.nodes: {'0&63': <unpyclib.structure.node instance at 0xb7676eec>}
nname: 166
n 166(None)[return None
]:
	i: 27(), 104(AL), 165()
	o: 

nname: 165
n 165(None)[]:
	i: 107(AF), 161()
	o: 166()

nname: 161
n 161(None)[]:
	i: 120(f), 141()
	o: 165()

nname: 141
n 141(None)[receiver(signal, *args, **kw)
continue
]:
	i: 120(t)
	o: 161()

nname: 120
n 120(signal in signals)[for receiver, signals in mapping.iteritems():
]:
	i: 107(for)
	o: 141(t), 161(f)

nname: 107
n 107(None)[]:
	i: 104(loop)
	o: 120(for), 165(AF)

nname: 104
n 104(None)[]:
	i: 86(), 103()
	o: 107(loop), 166(AL)

nname: 103
n 103(None)[]:
	i: 55(f)
	o: 104()

nname: 86
n 86(None)[args = (sender,) + args
]:
	i: 55(t)
	o: 104()

nname: 55
n 55(sender is not None)[log.debug('MESSAGE %s from %s', signal, sender)
]:
	i: 3(), 53(AE)
	o: 86(t), 103(f)

nname: 53
n 53(None)[]:
	i: 17(f)
	o: 55(AE)

nname: 27
n 27(None)[log.warn('No handler for signal %s from sender %s', signal, sender)
]:
	i: 17(t)
	o: 166()

nname: 17
n 17(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 0(except)
	o: 27(t), 53(f)

nname: 3
n 3(None)[mapping = _connected[sender]
]:
	i: 0(try)
	o: 55()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 17(except)

nname: 166
n 166(None)[return None
]:
	i: 27(), 55(AL), 17(f), 107(AF), 120()
	o: 

nname: 27
n 27(None)[log.warn('No handler for signal %s from sender %s', signal, sender)
]:
	i: 17(t)
	o: 166()

nname: 17
n 17(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 0(except)
	o: 27(t), 166(f)

nname: 120
n 120(None)[for receiver, signals in mapping.iteritems():
if signal in signals:
	receiver(signal, *args, **kw)
	continue
]:
	i: 107(for)
	o: 166()

nname: 107
n 107(None)[]:
	i: 55(loop)
	o: 120(for), 166(AF)

nname: 55
n 55(None)[log.debug('MESSAGE %s from %s', signal, sender)
if sender is not None:
	args = (sender,) + args
]:
	i: 3(), 53(AE)
	o: 107(loop), 166(AL)

nname: 3
n 3(None)[mapping = _connected[sender]
]:
	i: 0(try)
	o: 55()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 17(except)

nname: 166
n 166(None)[return None
]:
	i: 55(AL), 17(f), 107(AF), 120()
	o: 

nname: 17
n 17(None)[except KeyError:
	log.warn('No handler for signal %s from sender %s', signal, sender)
]:
	i: 0(except)
	o: 166()

nname: 120
n 120(None)[for receiver, signals in mapping.iteritems():
if signal in signals:
	receiver(signal, *args, **kw)
	continue
]:
	i: 107(for)
	o: 166()

nname: 107
n 107(None)[]:
	i: 55(loop)
	o: 120(for), 166(AF)

nname: 55
n 55(None)[log.debug('MESSAGE %s from %s', signal, sender)
if sender is not None:
	args = (sender,) + args
]:
	i: 3(), 53(AE)
	o: 107(loop), 166(AL)

nname: 3
n 3(None)[mapping = _connected[sender]
]:
	i: 0(try)
	o: 55()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 17(except)

self.nodes: {0: <unpyclib.structure.node instance at 0xb7676acc>, 3: <unpyclib.structure.node instance at 0xb7676dec>, 166: <unpyclib.structure.node instance at 0xb767c08c>, 107: <unpyclib.structure.node instance at 0xb7676d0c>, 17: <unpyclib.structure.node instance at 0xb767c5ac>, 53: <unpyclib.structure.node instance at 0xb7676dcc>, 55: <unpyclib.structure.node instance at 0xb767c2cc>, 120: <unpyclib.structure.node instance at 0xb767c5cc>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
_connected = dict()
def connect(receiver, signal, sender=None):
	log.debug('Connecting receiver %s to sender %s on signal %s', receiver, sender, signal)
	linked = _connected.get(sender)
	if linked is None:
		_connected[sender] = {receiver: set([signal])}
	else:
		if receiver in linked:
			linked[receiver].add(signal)
		else:
			linked[receiver] = set([signal])
	return None

def disconnect(receiver, signal, sender=None, wipe=True):
	log.debug('Disconnecting receiver %s from sender %s on signal %s (wipe=%s)', receiver, sender, signal, wipe)
	linked = _connected.get(sender)
	linked[receiver].discard(signal)
	if wipe or not linked[receiver]:
		del linked[receiver]
	if not linked:
		del _connected[sender]

def send(signal, sender=None, *args, **args):
	pass

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb766fcac>}
from __future__ import absolute_import
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
_connected = dict()
def connect(receiver, signal, sender=None):
	log.debug('Connecting receiver %s to sender %s on signal %s', receiver, sender, signal)
	linked = _connected.get(sender)
	if linked is None:
		_connected[sender] = {receiver: set([signal])}
	else:
		if receiver in linked:
			linked[receiver].add(signal)
		else:
			linked[receiver] = set([signal])
	return None

def disconnect(receiver, signal, sender=None, wipe=True):
	log.debug('Disconnecting receiver %s from sender %s on signal %s (wipe=%s)', receiver, sender, signal, wipe)
	linked = _connected.get(sender)
	linked[receiver].discard(signal)
	if wipe or not linked[receiver]:
		del linked[receiver]
	if not linked:
		del _connected[sender]

def send(signal, sender=None, *args, **args):
	pass

